//
// Created by Felix on 24-5-16.
//

#ifndef GAZE_CAMERAUPDATEDETAILSDTOVALIDATE_HPP
#define GAZE_CAMERAUPDATEDETAILSDTOVALIDATE_HPP

#include "service/CameraService.hpp"

class CameraUpdateDetailsDtoValidate {
public:
    static bool validateRequireCameraId(
            CameraService &iCameraService,
            const oatpp::Int32 &cameraId
    ) {
        if (cameraId <= 0) return false;
        auto camera = iCameraService.getCameraById(cameraId);
        if (!camera) return false;
        return true;
    }

    static bool validateRequireStatus(
            const oatpp::Object<CameraUpdateDetailsDto> &dto
    ) {
        switch (dto->status) {
            case 1:
            case 2:
                return true;
            default:
                return false;
        }
    }
};

#endif //GAZE_CAMERAUPDATEDETAILSDTOVALIDATE_HPP
